import { Controller, Get, Inject } from '@midwayjs/core'
import {
  ApiBearerAuth,
  ApiOperation,
  ApiResponse,
  ApiTags
} from '@midwayjs/swagger'

import { CommonService } from './common.service'
import { GetUserInfoVO } from './common.vo'

@ApiBearerAuth()
@ApiTags('通用接口')
@Controller('/common')
export class CommonController {
  @Inject()
  commonService: CommonService

  @ApiOperation({ summary: '获取用户信息' })
  @ApiResponse({ status: 200, type: GetUserInfoVO })
  @Get('/userInfo')
  async getUserInfo() {
    return await this.commonService.handleGetUserInfo()
  }
}
